//index.js
//获取应用实例
const app = getApp()

Page({
  onShareAppMessage: function () {
    return {
      title: '我的收藏',
      imageUrl: 'https://resource.160nurse.com/upload/miniprogram/index.jpeg'
    }
  },
	hd_click:function(options){
		 var that=this;
		 wx.request({
		 		url: app.apiDomain + "index.php?c=health&a=news&type="+options.target.id,
		 		method:'get',
		 		success:function(res){
		 				that.setData({
		 						news_list: res.data.data.list,
		 						news_data: res.data.data,
		 						top_one:res.data.data.top_one,
		 				});	  			
		 		},
		 });
		 wx.request({
		 		url:"https://api.160nurse.com/index.php?c=health&a=category&type="+options.target.id,
		 		method:'get',
		 		success:function(res){
		 				that.setData({
		 						fen_lei: res.data.data,
		 				});	  			
		 		}
		 });
	},
	onLoad: function (options) {
			var that=this;
      app.request(app.apiDomain + "index.php?c=health&a=news&type=" + options.type, [], function (res) {
        that.setData({
          news_list: res.data.data.list,
          news_data: res.data.data,
          top_one: res.data.data.top_one,
        });
      });
			wx.request({
          url: app.apiDomain + "index.php?c=health&a=category&type="+options.type,
					method:'get',
					success:function(res){
							that.setData({
									fen_lei: res.data.data,
							});	  			
					}
			});
	},
  onShareAppMessage: function () {
    return app.onShareAppMessage();
  },
})


 


